package com.wanghaoran.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author wanghaoran
 */
@ColumnWidth(20)
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT, verticalAlignment = VerticalAlignmentEnum.CENTER)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT, verticalAlignment = VerticalAlignmentEnum.CENTER)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseExcel implements Serializable {

    @ExcelProperty(value = {"课程信息统计表", "课程名称"})
    private String title;

    @ExcelProperty(value = {"课程信息统计表", "课程类别"})
    private String category;

    @ExcelProperty(value = {"课程信息统计表", "课程顺序"})
    private Integer idx;

    @ExcelProperty(value = {"课程信息统计表", "课程学时"})
    private Integer hours;

    @ColumnWidth(40)
    @ExcelProperty(value = {"课程信息统计表", "课程描述"})
    private String info;

    @ExcelProperty(value = {"课程信息统计表", "首次创建日期"})
    @DateTimeFormat("yyyy/MM/dd HH:mm:ss")
    private LocalDateTime created;

    @ExcelProperty(value = {"课程信息统计表", "最后创建日期"})
    @DateTimeFormat("yyyy/MM/dd HH:mm:ss")
    private LocalDateTime updated;
}
